#include <stdio.h>
#include <unistd.h>
#include "plat_storage.h"

#define TEST_FILE "./out.test.txt"

int main()
{
    char buff[1024] = {0};
    CPlatStorage* storage = new CPlatStorage();

    printf("WriteAll: %d \r\n", storage->WriteAll(TEST_FILE, "123\n", 4));
    printf("Append: %d \r\n", storage->Append(TEST_FILE, "456\n", 4));
    printf("ReadLine: %d [%s]\r\n", storage->ReadLine(TEST_FILE, buff, sizeof(buff), 2), buff);
    printf("ReadAll: %d [%s]\r\n", storage->ReadAll(TEST_FILE, buff, sizeof(buff)), buff);
    printf("IsExist: %d \r\n", storage->IsExist(TEST_FILE) ? 1 : 0);
    printf("IsFolder: %d \r\n", storage->IsFolder(TEST_FILE) ? 1 : 0);
    printf("SizeOf: %d \r\n", storage->SizeOf(TEST_FILE));
    printf("Delete: %d \r\n", storage->Delete(TEST_FILE));

    delete storage;
    return 0;
}
